package com.heima.method;

public class Demo14 {
    public static void main(String[] args) {
        int[] a=new int[]{22,12,21,23,32,44,123,32,21,1,4,42,64,22};
        int max=max(a);
        System.out.println(max);
    }
    public static int max(int[] a){
        int j=a[0];
        for (int i = 0; i <a.length ; i++) {
            if(a[i]>j){
                j=a[i];
            }
        }
        return j;
    }
}
